<extend name="Common@Layout:hui" />
<block name="title"><title>微信菜单管理</title></block>
<block name="style">
</block>

<block name="main">
	<nav class="breadcrumb">
		<i class="Hui-iconfont"></i>
		 首页 <span class="c-gray en">&gt;</span>
		开发工具 <span class="c-gray en">&gt;</span>  
		 微信自定义菜单
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
	</nav>
	<div class="pd-20">
		<form class="validator_form shuaxin" action="{:U('dosort_post')}" method="post">
			<div class="panel-header do-action cl">
				<a href="{:U('Menu/tijiao')}" class="btn btn-success size-S radius r">提交</a>
				<a href="javascript:;" onclick="open_iframe_dialog('edit.html','添加',['90%','90%'],1)" class="btn btn-primary size-S radius r mr-20">添加</a>
			</div>
			<php>
				//$result = _get_list_data('/Wexin/Menu/admin/',array(),$map,D('WxMenu'),100,'listorder asc');
			</php>
			<table class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th width="30">ID</th>
						<th width="30">PID</th>
						<th width="30">排序</th>
						<th width="100">name</th>
						<th width="100">type</th>
						<th>url</th>
						<th width="120">key</th>
						<th width="100">操作</th>
					</tr>
				</thead>
				<tbody id="miniData">
					<foreach name="menu" item="vo">
					<tr class="text-c">
						<td><input type="checkbox" value="{$vo.id}" name="ids[]">{$vo.id}</td>
						<td>{$vo.pid}</td>
						<td>{$vo.listorder}</td>
						<td style="text-align:left;"><if condition="$vo['pid']">-----</if>{$vo.name}</td>
						<td>{$vo.type}</td>
						<td>{$vo.url}</td>
						<td>{$vo.key}</td>
						<td class="f-14">
							<if condition="$vo['pid'] eq 0"><a href="javascript:;" onclick="open_iframe_dialog('{:u('edit','pid='.$vo['id'])}','子节点',['90%','90%'],1)" title="子节点">加子节点</a></if> 
							<a href="javascript:;" onclick="open_iframe_dialog('{:u('edit','id='.$vo['id'])}','修改',['90%','90%'],1)" title="修改"><i class="Hui-iconfont"></i></a> 
	            			<a style="text-decoration:none" class="ml-5 mini_del" data-url="{:U('del','ids='.$vo['id'])}" href="javascript:;" title="删除"><i class="Hui-iconfont"></i></a>
						</td>
					</tr>
					<foreach name="vo['sub_button']" item="vo2">
						<tr class="text-c">
							<td><input type="checkbox" value="{$vo2.id}" name="ids[]">{$vo2.id}</td>
							<td>{$vo2.pid}</td>
							<td>{$vo2.listorder}</td>
							<td style="text-align:left;"><if condition="$vo2['pid']">-----</if>{$vo2.name}</td>
							<td>{$vo2.type}</td>
							<td>{$vo2.url}</td>
							<td>{$vo2.key}</td>
							<td class="f-14">
								<a href="javascript:;" onclick="open_iframe_dialog('{:u('edit','id='.$vo2['id'])}','修改',['90%','90%'],1)" title="修改"><i class="Hui-iconfont"></i></a> 
		            			<a style="text-decoration:none" class="ml-5 mini_del" data-url="{:U('del','ids='.$vo2['id'])}" href="javascript:;" title="删除"><i class="Hui-iconfont"></i></a>
							</td>
						</tr>
					</foreach>
					</foreach>
				</tbody>
				
			</table>
			
	
			<div id="page" style="text-align:center;margin:20px 0;"></div>
		</form>
		{$result['pagetpl']}
	</div>
</block>

<block name="script">
</block>